<%--

<!------------------------------------------------------------------------------
 - Copyright 2007 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   CATALOG_SECURITY
 - AUTHOR           :   Saint Peng 
 - DATE CREATE      :   2007/03/29
 - DESCRIPTION      :   a SEARCH CONTENT JSP file for the function, CATALOG_SECURITY
 -                  :   
 -                  :   
 -                  :   
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2007/03/29   Saint Peng      1.0                 source is generated.
 -
 -
 -
------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page import="com.erp.app.catalog.catalogSecurity.vo.CatalogSecurityHdrVo"%>
<%@ page import="com.erp.app.catalog.catalogSecurity.web.CatalogSecuritySearchAction"%>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<% try { %>

<jsp:useBean id="catalogSecuritySearchForm" scope="session" type="com.erp.app.catalog.catalogSecurity.web.CatalogSecuritySearchForm" />

<%
ArrayList catalogSecurityList = catalogSecuritySearchForm.getResultList();
pageContext.setAttribute("catalogSecurityList", catalogSecurityList);
TableSchema ts = catalogSecuritySearchForm.getTs();
TableSchema[] childTsList = catalogSecuritySearchForm.getChildTs();
//TableSchema dtlChildTs = childTsList[CatalogSecuritySearchAction.TAB_IDX_DTL];
%>

<script language="javascript">

	function doLoad() {
		<%
		if (CommonUtil.nullToString((String)session.getAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE)).equals(ProjectConstants.GENERIC_YES)) {
			session.removeAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE);
			out.println("alert('Records saved.');");
		}
		%>
	}


	function doEdit(val) {
		document.forms[0].editUserCode.value = val;
		doSubmit('<%=catalogSecuritySearchForm.ACTION_EDIT%>');
	}

	function alertSaveMsg() {
		return false;
	}

</script>

<body onLoad="javascript:doLoad();autofill_init();">
<html:form action="/catalogSecuritySearch">

<html:hidden property="pageEvent"/>
<html:hidden property="pageMode"/>

<html:hidden property="editUserCode"/>



<table class="table_top">

<tr>
	<td>
		<chtml:button form="catalogSecuritySearchForm" pageEvent="<%=CatalogSecuritySearchAction.ACTION_EXIT%>"
			styleClass="button1"/>
		<chtml:button form="catalogSecuritySearchForm" pageEvent="<%=CatalogSecuritySearchAction.ACTION_SEARCH%>"
			styleClass="button1"/>
		<chtml:button form="catalogSecuritySearchForm" pageEvent="<%=CatalogSecuritySearchAction.ACTION_CLEAR%>"
			styleClass="button1"/>
	</td>
</tr>

<tr>
	<td>

		<table class="table_crit">

		<tr class="col_label"> 
			<td class="col_label">&nbsp;</td>
			<td class="col_label_fr_to">
				<%
				webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_FROM");
				%>
				<%=webLabel%>
			</td>
			<td class="col_label_fr_to">
				<%
				webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_TO");
				%>
				<%=webLabel%>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_USER_CODE");
			%>
			<td class="col_label">
			<%=webLabel%>
			</td>
			<td class="col_value">
				<html:text property="srchHdrCatalogUserIdFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
			<td class="col_value">
				<html:text property="srchHdrCatalogUserIdTo" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchDisplaySize%>"/>
			</td>
		</tr>
		<tr>
			<%
			webLabel = ts.getDisplayWebLabelWithColonByObjectId("LBL_SRCH_USER_NAME");
			%>
			<td class="col_label">
			<%=webLabel%>
			</td>
			<td class="col_value">
				<html:text property="srchHdrUserNameFr" styleClass="textbox1" maxlength="<%=srchColSize%>" size="<%=srchColLongSize%>"/>
			</td>
			<td class="col_value">
			</td>
		</tr>	

		</table>

	</td>
</tr>

<tr>
	<td><font color='red'><html:errors/></font></td>
</tr>

<tr>
	<td class="grid_page">
	<%if(catalogSecuritySearchForm.getTotalPage() == 0 ) { %>
		&nbsp;
	<%} else { %>
		<input type="button" value="Go" class="button1" onClick="javascript:doSubmit('<%=catalogSecuritySearchForm.ACTION_SCROLL_TO%>');" >
		Page
		<html:text property="scrollTo" styleClass="textbox1" readonly="<%=rowReadOnly%>" maxlength="4" size="4" value="<%=String.valueOf(catalogSecuritySearchForm.getCurrentPage())%>"/>
		of <%=catalogSecuritySearchForm.getTotalPage()%>
	<%} %>
		<input type="button" value="|&lt;&lt;" class="button1" onClick="javascript:doSubmit('<%=catalogSecuritySearchForm.ACTION_SCROLL_TO_FIRST_PAGE%>');" <%=catalogSecuritySearchForm.getSidx() == 0 ? "disabled" : ""%>>
		<input type="button" value="&lt;&lt;" class="button1" onClick="javascript:doSubmit('<%=catalogSecuritySearchForm.ACTION_SCROLL_LEFT%>');" <%=catalogSecuritySearchForm.getSidx() == 0 ? "disabled" : ""%>>
		<input type="button" value="&gt;&gt;" class="button1" onClick="javascript:doSubmit('<%=catalogSecuritySearchForm.ACTION_SCROLL_RIGHT%>');" <%=catalogSecuritySearchForm.getSidx() < Integer.parseInt(catalogSecuritySearchForm.getLastPageSidx()) ? "" : "disabled"%>>
		<input type="button" value="&gt;&gt|" class="button1" onClick="javascript:doSubmit('<%=catalogSecuritySearchForm.ACTION_SCROLL_TO_LAST_PAGE%>');" <%=catalogSecuritySearchForm.getSidx() < Integer.parseInt(catalogSecuritySearchForm.getLastPageSidx()) ? "" : "disabled"%>>
	</td>
</tr>

</table>


<table class="table_grid">

	<tr class="grid_header">
		<%
		webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_USER_CODE");
		%>
		<td class="grid_header_col" nowrap>
			<%=webLabel%>
		</td>
		<%
		webLabel = ts.getDisplayWebLabelByObjectId("LBL_GRID_USER_NAME");
		%>
		<td class="grid_header_col" nowrap>
			<%=webLabel%>
		</td>
		
	</tr>

	<logic:iterate id="srchRsltRow" name="catalogSecurityList" indexId="idx" length="<%=String.valueOf(ProjectConstants.MAX_DISPLAY)%>" offset="<%=String.valueOf(catalogSecuritySearchForm.getSidx())%>">

	<%
		CatalogSecurityHdrVo row = (CatalogSecurityHdrVo) srchRsltRow;
		String gridStyle = (idx.intValue()%2 == 0) ? "grid_result1" : "grid_result2";
	%>

	<% if(row != null) {%>

	<tr class="<%=gridStyle%>" onmouseover="mouseOverHighlight(event,'grid_row_action_hilite')"
	onmouseout="mouseOutHighlight('<%=gridStyle%>')"
	onclick="javascript:doEdit('<%=StringUtil.escapeSlash(row.getUserCode(), "'") %>')">
		<td class="grid_outline" nowrap>
			<bean:write name="srchRsltRow" property="userCode" filter="true"/>&nbsp;
		</td>
		<td class="grid_outline" nowrap>
			<bean:write name="srchRsltRow" property="hdrUserName" filter="true"/>&nbsp;
		</td>
		
	</tr>

	<% } // end if(row != null) %>

	</logic:iterate>

</table>

</html:form>

<% } catch(Exception e) { e.printStackTrace(); } %>
